<?php
// 本类由系统自动生成，仅供测试用途
class KzzxAction extends Action {

	
	

    //公版
    public function query(){
    	header("Content-Type:text/html; charset=utf-8");
    	$environment=D('Environment');$usr=D('Usr');
      $arr_usross=$environment->setenvironment(MODULE_NAME);$usross=$arr_usross['data'];

      $arr_usro=$usr->getusrobyusrid(1);$usro=$arr_usro['data'];pd($arr_usro);

      $this->assign('ttl','控制中心');
      $this->display('query');
  
    }

    public function doexesql(){
      header("Content-Type:text/html; charset=utf-8");
      $sql=D('Sql');

      $sqltxt=gp()['sqltxt'];

      $arr_result=$sql->exesql($sqltxt);$result=$arr_result['data'];

      $data['result']=je($result);

      $this->ajaxReturn($data,'json');
      
    }
    
    public function dourlencode(){
      header("Content-Type:text/html; charset=utf-8");
     

      $sqltxt=gp()['sqltxt'];

      $data['url_tail']=urldecode($sqltxt);

      $this->ajaxReturn($data,'json');
      
    }
    
    public function showsqlresult(){
      header("Content-Type:text/html; charset=utf-8");

      $sql=D('Sql');

      $environment=D('Environment');
      $arr_usross=$environment->setenvironment(MODULE_NAME);$usross=$arr_usross['data'];

      $sqltxt=gp()['sqltxt'];

      $arr_result=$sql->exesql($sqltxt);$result=$arr_result['data'];
      
      $this->assign('result',$result);
      $this->assign('ttl','结果');
      $this->display('showsqlresult');
  
    }

    public function showsqlresult_table(){
      header("Content-Type:text/html; charset=utf-8");
      $sql=D('Sql');

      $environment=D('Environment');
      $arr_usross=$environment->setenvironment(MODULE_NAME);$usross=$arr_usross['data'];

      $sqltxt=gp()['sqltxt'];

      $arr_result=$sql->exesql($sqltxt);$result=$arr_result['data'];
      
      $this->assign('result',$result);
      $this->assign('ttl','结果_表格');
      $this->display('showsqlresult_table');
  
    }

}